<script setup>
import "quarkd/lib/navbar";
import "quarkd/lib/cell";

import { useRouter } from 'vue-router';
import { useLoginedStore } from '@/stores/logined';

const store = useLoginedStore();

const router = useRouter();

function back() {
  router.push({ name: 'main' });
}

function logout() {
  store.remove(); // 调用 Store 中的 Action
  router.push({ name: 'login' });
}

</script>

<template>
  <quark-navbar title="个人设置" closehide @leftclick="back"/>
  <quark-cell-group class="wrapper">
    <quark-cell title="修改个人信息" islink to="/main" />
    <quark-cell title="修改登录密码" islink to="/main" />
    <quark-cell title="注销账号" islink to="/main" />
    <quark-cell title="退出登录" @click.stop="logout"/>
  </quark-cell-group>
</template>

<style scoped>
.wrapper {
  margin: 15px;
}
</style>